﻿<view:ModuleView x:Class="UCOLOR.View.OrderView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers" 
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UCOLOR.View"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1118" FontWeight="Bold" Focusable="True" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
    <view:ModuleView.Resources>
        <!--<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/DevExpress.RealtorWorld.Xpf;component/Themes/Palette.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>-->
                <local:ScalablePaddingConverter x:Key="ScalablePaddingConverter"/>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />
        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:ModuleView.Resources>
    <Grid Name="Center" Background="#FFFFFFFF">
        <Border BorderBrush="#FF515151" BorderThickness="1" Margin="10,10,10,10" Padding="5">
            <Grid Width="auto">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="600*" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="110" />
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Content="填写核对订单信息"/>
                    <Button Grid.Column="2" Content="（1）我的购物车"/>
                    <Button Grid.Column="3" Content="（2）填写核对订单信息"/>
                    <Button Grid.Column="4" Content="（3）提交定单"/>
                </Grid>
                   <dxg:GridControl x:Name="CurrentCart" Grid.Row="1" ItemsSource="{Binding Data}" Width="Auto" ShowBorder="True" ShowLoadingPanel="False" IsTabStop="True" >
                    <dxg:GridControl.View>
                        <dxg:TableView x:Name="HomesView" AutoWidth="True" AllowPerPixelScrolling="True" ShowGroupPanel="False" AllowFilterEditor="False" ShowGroupedColumns="True"
                        BestFitMode="Smart" BestFitArea="All" ShowHorizontalLines="False" AllowEditing="False" NavigationStyle="Row" AllowHorizontalScrollingVirtualization="False" FadeSelectionOnLostFocus="False"
                        ShowIndicator="False">
                            <!--<interactivity:Interaction.Triggers>
                                <interactivity:EventTrigger EventName="KeyDown">
                                    <helpers:KeyEventAction Key="Enter" Command="{Binding Parent.Parent.ShowListingCommand}" CommandParameter="{Binding ElementName=HomesView, Path=FocusedRow}"/>
                                </interactivity:EventTrigger>
                                <interactivity:EventTrigger EventName="RowDoubleClick">
                                    <interactivity:InvokeCommandAction Command="{Binding Parent.Parent.ShowListingCommand}" CommandParameter="{Binding ElementName=HomesView, Path=FocusedRow}"/>
                                </interactivity:EventTrigger>
                            </interactivity:Interaction.Triggers>-->
                        </dxg:TableView>
                    </dxg:GridControl.View>

                    <dxg:GridControl.Columns>
                        
                        <dxg:GridColumn FieldName="PhotoSource" Header="全选" AllowColumnFiltering="False" FixedWidth="True" Width="100">
                            <dxg:GridColumn.CellTemplate>
                                <DataTemplate>
                                    <Image    Source="{Binding Path=Value}" Stretch="Uniform" Margin="3"  Height="200"/>
                                </DataTemplate>
                            </dxg:GridColumn.CellTemplate>
                        </dxg:GridColumn>
                        <dxg:GridColumn FieldName="ProductName" Header="商品" Width="350" />
                        <dxg:GridColumn FieldName="Price" Header="价格" Width="160" />
                        <dxg:GridColumn FieldName="Baths" Header="优惠" Width="160" />
                        <dxg:GridColumn FieldName="HouseSize" Header="数量" Width="160">
                            <dxg:GridColumn.EditSettings>
                                <dxe:TextEditSettings DisplayFormat='{}{0:n0} Sq Ft' />
                            </dxg:GridColumn.EditSettings>
                        </dxg:GridColumn>
                        <dxg:GridColumn FieldName="" Header="操作" Width="160">
                            <dxg:GridColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Width="50" Height="30" Content="删除"/>
                                </DataTemplate>
                            </dxg:GridColumn.CellTemplate>
                        </dxg:GridColumn>
                    </dxg:GridControl.Columns>
                </dxg:GridControl>

                <Grid Grid.Row="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="110" />
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="4" Content="去结算"/>
                </Grid>
            </Grid>
        </Border>
        <StackPanel />
    </Grid>
   
</view:ModuleView>
